/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task07.task0715;

import java.util.ArrayList;

/* 
又见“我是山姆”
*/

public class Solution {
    public static void main(String[] args) throws Exception {
        //在此编写你的代码
        ArrayList<String> strings = new ArrayList<>();
        strings.add("山姆");
        strings.add("我");
        strings.add("是");
        for (int i = 1; i < strings.size() + 1; i += 2) {
            strings.add(i, "火腿");
        }
        for (String string : strings) {
            System.out.println(string);
        }

    }
}
